{include file="common/top" /}
<link  type="text/css" href="__static/ossupload/style.css"/>
<div style="padding: 20px;background: #ffffff;" >
	<form class="layui-form " action="">
	<div class="layui-form-item">
		<label class="layui-form-label">*报销金额：</label>
		<div class="layui-col-xs4">
			<input type="text" name="money" lay-verify="required" autocomplete="off" placeholder="请输入报销金额" class="layui-input">
		</div>
		<label class="layui-form-label">*报销类别：</label>
		<div class="layui-col-xs4">
			<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="如：采购经费，活动经费等" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">*费用明细：</label>
		<div class="layui-col-xs8">
			<textarea name="remark" autocomplete="off" placeholder="请输入详细备注" class="layui-textarea"></textarea>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">*收款账号：</label>
		<div class="layui-col-xs4">
			<select name="user_account_id" lay-verify="required" autocomplete="off">
				<option value="" >请选择</option>
				{volist name="acc_list" id="vo"}
					<option value="{$vo.id}" >{$vo.name}{$vo.number}</option>
				{/volist}
	        </select>
		</div>
		<label class="layui-form-label">
			 <button type="button" class="layui-btn layui-btn-xs" onclick="get_account()">添加新的账户</button>
		</label>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">凭证上传：</label>
		<div class="layui-col-xs8">
			<div id="container">
				<a id="selectfiles" href="javascript:void(0);" class='btn layui-btn'>选择文件</a>
				<a id="postfiles" href="javascript:void(0);" class='btn layui-btn'>开始上传</a>
			</div>
			<pre id="console"></pre>
			<p>&nbsp;</p>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"></label>
		<div class="layui-col-xs10">
			<h4>您所选择的文件列表：</h4>
			<div id="ossfile">你的浏览器不支持flash,Silverlight或者HTML5！</div>
			<br/>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"></label>
		<div class="layui-col-xs10" >
			<div id="img"></div>
		</div>
	</div>
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<input type="hidden" id='image'  name="screenshot_url" value="">
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">添加</button>
		</div>
	</div>
	
	</form>
	
</div>
{include file="common/footer" /}
<script type="text/javascript" src="__static/ossupload/lib/crypto1/crypto/crypto.js"></script>
<script type="text/javascript" src="__static/ossupload/lib/crypto1/hmac/hmac.js"></script>
<script type="text/javascript" src="__static/ossupload/lib/crypto1/sha1/sha1.js"></script>
<script type="text/javascript" src="__static/ossupload/lib/base64.js"></script>
<script type="text/javascript" src="__static/ossupload/lib/plupload-2.1.2/js/plupload.full.min.js"></script>
<script type="text/javascript" src="__static/ossupload/upload.js"></script>
<script>
	var form,layer
	layui.use(['form', 'layedit', 'laydate'], function(){
		  form = layui.form ,layer = layui.layer;
		  
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] });
			$.post("{:url('add_baoxiao')}?t=json",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) {
					layer.msg(data['msg'], { icon : 6 });
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			
			return false;
		  });
		  //刷新select
		  function add_bx(msg){
				form.render();
				layer.msg(msg, { icon : 6 });
			}
		});

//添加新的账户
function get_account(){
	layer.open({
        type: 2,
        title: '添加新收款账号',
        area: ['50%', '50%'],
        fixed: false, //不固定
        maxmin: true,
        shadeClose: true,
        scrollbar: false, //- 是否允许浏览器出现滚动
        content: "{:url('add_user_account')}"
    });
    //layer.full(index);
	
}
	
	
	
</script>
